move vue and vue-router to external#1066
Merged
webfansplz merged 2 commits intovuejs:mainfrom Mar 23, 2026
Merged
Conversation
✅ Deploy Preview for vue-devtools-docs canceled.
|
Co-authored-by: skirtle <65301168+skirtles-code@users.noreply.github.com>
skirtles-code
approved these changes
Mar 22, 2026
Contributor
skirtles-code
left a comment
There was a problem hiding this comment.
Worth noting that the problem being fixed here is a regression. The types are built correctly in 8.0.7 but are incorrect for 8.1.0.
I believe the change proposed here is the correct way to get the types back to how they were in 8.0.7.
The problem was introduced by updating tsdown. I believe the underlying cause is sxzz/rolldown-plugin-dts@0fa6905. This appears to be a deliberate change. Previously types were not inlined by default, but now they use the same configuration as the JS build. In the devtools-kit package we only use vue and vue-router for type purposes, so previously they didn't need to be configured as externals.
@vue/devtools-applet
@vue/devtools-core
@vue/devtools
@vue/devtools-api
@vue/devtools-kit
@vue/devtools-electron
@vue/devtools-shared
@vue/devtools-ui
vite-plugin-vue-devtools
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
@vue/devtools-kitbundles its type declarations via tsdown, it inlines the types fromvue-router(a devDependency). This causes vue-router'sdeclare module 'vue'augmentations — specifically theGlobalComponentsinterface withRouterViewandRouterLink— to be embedded indist/index.d.ts.This creates type conflicts for any library that also augments
GlobalComponentswith its ownRouterVieworRouterLinkcomponents (e.g. @kitbag/router). TypeScript's declaration merging requires subsequent property declarations to have the same type, so consumers see errors like:Caution
TS2717: Subsequent property declarations must have the same type. Property 'RouterView' must be of type '...' but here has type '...'
The same inlining also causes Vue's
Apptype to be duplicated asApp$1, leading to type mismatches when passingAppinstances tosetupDevtoolsPlugin.Fix
Add
external: ['vue', 'vue-router']to the tsdown config for@vue/devtools-kit. This prevents tsdown from inlining their type declarations into the bundled.d.tsoutput, keeping them as externalimport(...)references instead. Both packages are already devDependencies — their types should not be bundled.Test plan
@vue/devtools-kitand verifydist/index.d.tsno longer contains vue-router'sGlobalComponentsaugmentationGlobalComponentswith their own router components no longer getTS2717errors